#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
//https://www.luogu.com.cn/problem/P1192
using namespace std;
const int N = 1e5 + 10, Mod = 1e5 + 3;
int n, k;
int f[N];
int main()
{

	cin >> n >> k;
	f[0] = 1;
	for (int i = 1; i <= n; ++i)
	{
		for (int j = 1; j <= k && i - j >= 0; ++j)
		{
			f[i] = (f[i] + f[i - j]) % Mod;
		}
	}
	cout << f[n] << endl;

	return 0;
}